package top.tieyan.fs.group.web;

import lombok.extern.slf4j.Slf4j;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.tieyan.fs.group.entity.User;
import top.tieyan.fs.group.vo.Directory;

/**
 * @author TieYan
 * @date 2018/7/19
 */
@RestController
@Slf4j
public class UserController {
	@PostMapping(value = "/reg", produces = MediaType.APPLICATION_XML_VALUE)
	public Directory reg(@RequestParam("domain") String domain, @RequestParam("user") String user){
		LOGGER.debug("Receive reg request ==>  domain:{}, user:{}", domain, user);

		User rUser = new User();
		rUser.setPassword("1234")
		.setDomain(domain)
		.setName(user);
		Directory directory = Directory.of(rUser);
		return directory;
	}
}
